<?php
$username=$_POST['username'];
$password=$_POST['password'];

$conn=mysqli_connect('localhost','root','root','user');

if($conn){
	$sql='select * from student where username="'.$username.'"and userpass="'.$password.'"';
	$result =mysqli_query($conn,$sql);
}else{
	echo '连接失败';
}
$count =mysqli_num_rows($result);

if($count==0){
	echo '0';//登录失败
}else{
	echo '1';
}
?>